Add support for unique-table-location#4582
Conversation
|
I don’t think this implementation is correct for Polaris. The main issue is that
I think the fix needs a table-specific helper for deriving default table create locations, and both direct create and staged create should use that helper when the request has no explicit location. View default locations should stay view-name-based, and namespace/register/load/drop/rename paths should not be affected. The fix also need targeted tests for those changes. |
@snazy Thanks for the detailed review, it helped highlight the Polaris-specific create-location paths that weren't covered by the Iceberg compatibility test. I've pushed an update that addresses the staged create and view-location concerns, and added targeted tests for both scenarios. I also updated the location derivation logic so direct and staged table creates follow the same path when unique-table-location is enabled. Please take another look when you have a chance. |
Fixes #4492
Summary
Add support for Iceberg's
unique-table-locationcatalog property when creating tables without an explicit location.Changes
CatalogProperties.UNIQUE_TABLE_LOCATIONwhen computing default table locations.LocationUtil.tableLocation(...)helper to generate table directory names.createTableInUniqueLocation().Validation
Verified Iceberg 1.11 uses the same
LocationUtil.tableLocation(...)helper whenunique-table-locationis enabled.Ran:
./gradlew :polaris-runtime-service:test \ --tests "org.apache.polaris.service.catalog.iceberg.IcebergCatalogRelationalTest.createTableInUniqueLocation"Result: passed.
Also ran:
Both passed.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)